<template >
  <keep-alive :include="cachedViews" >
    <div :is="currentView" >

    </div >
  </keep-alive >
</template >

<script >
  import usersMain from './main'

  export default {
    name: 'menus',
    components: { usersMain },
    data() {
      return {
        index: 0,
        view: [usersMain],
        params: {}
      }
    },
    computed: {
      currentView(){
        return this.view[this.index]
      },
      cachedViews() {
        return this.$store.state.tagsView.cachedViews
      }
    },
    methods: {
      changeView(index, id){
        this.index = index
        this.params = { id: id }
      },
      goBack(){
        this.changeView(0)
      },
      getParams(){
        return this.params
      }
    }
  }
</script >

